# ../addons/manilib/core/__init__.py

'''
$Rev: 8 $
$Author: pitkley $
$Date: 2009-11-01 17:54:55 +0000 (Sun, 01 Nov 2009) $
'''

# ==============================================================================
# >> IMPORTS
# ==============================================================================
# Python Imports
import os

# Eventscripts Imports
import es

# ==============================================================================
# >> GLOBALS
# ==============================================================================
#gamePath    = str(es.ServerVar("eventscripts_gamedir")).replace("\\", "/")
gamePath    = "/cstrike"
#clientsPath = "%s/cfg/mani_admin_plugin/clients.txt" % gamePath
#cflagsPath  = "%s/addons/eventscripts/mani/data/cflags.db" % gamePath
clientsPath = "die clientsPath Variable"
# ==============================================================================
# >> CLASSES
# ==============================================================================
class ManilibError(Exception):
    pass

# ==============================================================================
# >> FILES, DIRECTORIES & OS FUNCTIONS
# ==============================================================================
def get_game_dir(dir=None):
    '''
    !Gets an absolute path to a game directory
    @remark Implicitly replaces \\ with / (linux supporrt)
    @param dir Directory to append to the game directory
    @return An absolute path to the game directory plus \p dir.
    '''
    if dir:
        # Return
        return "%s/%s" % (gamePath, dir.replace("\\","/"))
    return gamePath